//package com.qg.rta;
//
//import cn.hutool.core.util.IdUtil;
//import cn.hutool.crypto.SecureUtil;
//import cn.hutool.http.HttpRequest;
//import cn.hutool.http.HttpUtil;
//import com.qg.rta.dto.kjb.dto.RtaRequest;
//
//import java.util.HashMap;
//import java.util.Map;
//
//public class ApplicationTest {
//
//    public static void main(String[] args) {
//
//        RtaRequest.Device.Builder builder = RtaRequest.Device.newBuilder().setOaid("c9dc70fc-76d5-4977-bcf7-1289cfc04deb");
//        Map<Integer, String> promotionTypes = new HashMap<>();
//        promotionTypes.put(0, "kwai_lite_laxin");
//
//        ;
//
//        String requestId = IdUtil.fastSimpleUUID();
//        long ts = System.currentTimeMillis();
//        String key="a639f4c71b4c4de4fa7b1da3bd0c2949";
//        RtaRequest rtaRequest = RtaRequest.newBuilder()
//                .setRequestId(requestId)
//                .setRequestTime(ts)
//                .setChannel("承宇齐光")
//                .setSign(SecureUtil.md5(requestId+ts+key))
//                .setDevice(builder.build())
//                .addPromotionType("kwai_lite_laxin").build();
//
//        byte[] byteArray = rtaRequest.toByteArray();
//        HttpRequest post = HttpUtil.createPost("https://promotion-partner.kuaishou.com/rest/n/rta/kjb");
//        post.header("Content-Type", "application/x-protobuf");
//        post.charset("UTF-8");
//        HttpRequest body = post.body(byteArray);
//        System.out.println(body.execute().body());
//    }
//}
